﻿namespace HeroldIT.Dnn.Modules
{
    /// <summary>
    /// Provides EventArgs that can be used to request data from an external source.
    /// </summary>
    /// <typeparam name="TArgument">The type of the event's argument.</typeparam>
    /// <typeparam name="TResult">The type of the event's result.</typeparam>
    public class DataRequestedEventArgs<TArgument, TResult> : EventArgs<TArgument>
    {
        #region properties

        /// <summary>
        /// Gets or sets the event's result.
        /// </summary>
        public TResult Result
        {
            get; set;
        }

        #endregion

        #region constructors

        /// <summary>
        /// Creates new DataRequestedEventArgs with the given <paramref name="argument"/>.
        /// </summary>
        /// <param name="argument">The argument to pass to the event.</param>
        public DataRequestedEventArgs(TArgument argument)
            : base(argument)
        {
            this.Result = default(TResult);
        }

        #endregion
    }
}
